Skip to contentSkip to conversation

Change in openvpn[master]: Log setting DNS via NRPT

Openvpn-devel In review stipa (Code Review) 2 participants 6 messages Aug 1, 2025 – Aug 3, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1754040821000.Ib2f30fe69cb676e347e4d59cd2db68db7568ba5b@...2715...

#1 lore raw

Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos, flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1126?usp=email

to review the following change.

Change subject: Log setting DNS via NRPT
......................................................................

Log setting DNS via NRPT

Unlike other ways of setting DNS, we don't log anything when we use NRPT. Since dco-win/--dns is the recommended configuration and it uses NRPT to set DNS, let's log it.

Change-Id Ib2f30fe69cb676e347e4d59cd2db68db7568ba5b

---
M src/openvpn/dns.c

1 file changed, 5 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/26/1126/1

src/openvpn/dns.c +5 -0
index ea3d91b..e079cd0 100644
@@ -461,6 +461,11 @@
     make_domain_list("dns search domains", search_domains, false,
                      nrpt.search_domains, sizeof(nrpt.search_domains));
 
+    msg(D_LOW, "%s NRPT DNS%s%s on '%s' (if_index = %d) using service",
+        (add ? "Setting" : "Deleting"), nrpt.resolve_domains[0] != 0 ? ", resolve domains" : "",
+        nrpt.search_domains[0] != 0 ? ", search domains" : "",
+        nrpt.iface.name, nrpt.iface.index);
+
     send_msg_iservice(o->msg_channel, &nrpt, sizeof(nrpt), &ack, "DNS");
 }
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1126?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ib2f30fe69cb676e347e4d59cd2db68db7568ba5b
Gerrit-Change-Number: 1126
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos, stipa.

cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1126?usp=email )

Change subject: Log setting DNS via NRPT
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1126?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ib2f30fe69cb676e347e4d59cd2db68db7568ba5b
Gerrit-Change-Number: 1126
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Sun, 03 Aug 2025 14:49:28 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw

PATCH 1/1 Log setting DNS via NRPT

In reply to a message not in the archive

From: Lev Stipakov <[email protected]...>

Unlike other ways of setting DNS, we don't log anything when we use NRPT. Since dco-win/--dns is the recommended configuration and it uses NRPT to set DNS, let's log it.

Change-Id Ib2f30fe69cb676e347e4d59cd2db68db7568ba5b

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1126
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

src/openvpn/dns.c +5 -0
index ea3d91b..e079cd0 100644
@@ -461,6 +461,11 @@
     make_domain_list("dns search domains", search_domains, false,
                      nrpt.search_domains, sizeof(nrpt.search_domains));
 
+    msg(D_LOW, "%s NRPT DNS%s%s on '%s' (if_index = %d) using service",
+        (add ? "Setting" : "Deleting"), nrpt.resolve_domains[0] != 0 ? ", resolve domains" : "",
+        nrpt.search_domains[0] != 0 ? ", search domains" : "",
+        nrpt.iface.name, nrpt.iface.index);
+
     send_msg_iservice(o->msg_channel, &nrpt, sizeof(nrpt), &ack, "DNS");
 }
 
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: Log setting DNS via NRPT

Looks good, and is a useful addition.

I haven't actually run the resulting binary yet (too lazy), but counted the arguments (twice!) and test compiled with mingw/ubuntu22 to see if the compiler disagrees.

Your patch has been applied to the master branch.

commit ff371d1aaa71ef89157ba89b8c992494bac31b34

Author: Lev Stipakov
Date:   Sun Aug 3 16:49:45 2025 +0200
     Log setting DNS via NRPT

     Signed-off-by: Lev Stipakov <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg32480.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by stipa. ( http://gerrit.openvpn.net/c/openvpn/+/1126?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: Log setting DNS via NRPT
......................................................................

Log setting DNS via NRPT

Unlike other ways of setting DNS, we don't log anything when we use NRPT. Since dco-win/--dns is the recommended configuration and it uses NRPT to set DNS, let's log it.

Change-Id Ib2f30fe69cb676e347e4d59cd2db68db7568ba5b

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg32480.html

---
M src/openvpn/dns.c

1 file changed, 5 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/26/1126/2

src/openvpn/dns.c +5 -0
index 2952a8a..22f4cec 100644
@@ -460,6 +460,11 @@
     make_domain_list("dns search domains", search_domains, false,
                      nrpt.search_domains, sizeof(nrpt.search_domains));
 
+    msg(D_LOW, "%s NRPT DNS%s%s on '%s' (if_index = %d) using service",
+        (add ? "Setting" : "Deleting"), nrpt.resolve_domains[0] != 0 ? ", resolve domains" : "",
+        nrpt.search_domains[0] != 0 ? ", search domains" : "",
+        nrpt.iface.name, nrpt.iface.index);
+
     send_msg_iservice(o->msg_channel, &nrpt, sizeof(nrpt), &ack, "DNS");
 }
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1126?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ib2f30fe69cb676e347e4d59cd2db68db7568ba5b
Gerrit-Change-Number: 1126
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1126?usp=email )

Change subject: Log setting DNS via NRPT
......................................................................

Log setting DNS via NRPT

Unlike other ways of setting DNS, we don't log anything when we use NRPT. Since dco-win/--dns is the recommended configuration and it uses NRPT to set DNS, let's log it.

Change-Id Ib2f30fe69cb676e347e4d59cd2db68db7568ba5b

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg32480.html

---
M src/openvpn/dns.c

1 file changed, 5 insertions(+), 0 deletions(-)
src/openvpn/dns.c +5 -0
index 2952a8a..22f4cec 100644
@@ -460,6 +460,11 @@
     make_domain_list("dns search domains", search_domains, false,
                      nrpt.search_domains, sizeof(nrpt.search_domains));
 
+    msg(D_LOW, "%s NRPT DNS%s%s on '%s' (if_index = %d) using service",
+        (add ? "Setting" : "Deleting"), nrpt.resolve_domains[0] != 0 ? ", resolve domains" : "",
+        nrpt.search_domains[0] != 0 ? ", search domains" : "",
+        nrpt.iface.name, nrpt.iface.index);
+
     send_msg_iservice(o->msg_channel, &nrpt, sizeof(nrpt), &ack, "DNS");
 }
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1126?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ib2f30fe69cb676e347e4d59cd2db68db7568ba5b
Gerrit-Change-Number: 1126
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged